package cn.class2.demo6

/**
  * Created by lzd on 2018/11/14.
  * 数组多个值匹配
  */
object Demo3 {
  def main(args: Array[String]): Unit = {
    val arr = Array(1, "hello", Demo3, 2.0)

    arr match {
      case Array(1, 2, x, y) => println(x + " " + y)
      case Array(2, x, y, z) => println(x + " " + y + " " + z)
      case Array(a, b, c, 2.0) => println(s"$a-$b-$c")
      case _ => println("No... ")
    }
  }
}
